home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form Form10
- Caption = "HexEdit v6.1a PD"
- ClientHeight = 8130
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 9195
- LinkTopic = "Form1"
- ScaleHeight = 8130
- ScaleWidth = 9195
- StartUpPosition = 3 'Windows Default
- Begin VB.CommandButton Command12
- Caption = "APPEND"
- Height = 255
- Left = 6720
- TabIndex = 17
- Top = 7320
- Width = 2295
- End
- Begin VB.CommandButton Command11
- Caption = "SEARCH"
- Height = 255
- Left = 4560
- TabIndex = 16
- Top = 7320
- Width = 1935
- End
- Begin VB.CommandButton Command10
- Caption = "AUTHOR"
- Height = 255
- Left = 6720
- TabIndex = 15
- Top = 7680
- Width = 2295
- End
- Begin VB.CommandButton Command9
- Caption = "QUIT"
- Height = 255
- Left = 4560
- TabIndex = 14
- Top = 7680
- Width = 1935
- End
- Begin VB.CommandButton Command8
- Caption = "HEX VALUE"
- Height = 255
- Left = 6720
- TabIndex = 13
- Top = 6960
- Width = 2295
- End
- Begin VB.CommandButton Command7
- Caption = "POSITION"
- Height = 255
- Left = 4560
- TabIndex = 12
- Top = 6960
- Width = 1935
- End
- Begin VB.CommandButton Command6
- Caption = "PAGE DOWN"
- Height = 255
- Left = 6720
- TabIndex = 11
- Top = 6600
- Width = 2295
- End
- Begin VB.CommandButton Command5
- Caption = "PAGE UP"
- Height = 255
- Left = 4560
- TabIndex = 10
- Top = 6600
- Width = 1935
- End
- Begin VB.CommandButton Command4
- Caption = "LEFT"
- Height = 255
- Left = 8040
- TabIndex = 9
- Top = 6240
- Width = 975
- End
- Begin VB.CommandButton Command3
- Caption = "RIGHT"
- Height = 255
- Left = 6720
- TabIndex = 8
- Top = 6240
- Width = 975
- End
- Begin VB.CommandButton Command2
- Caption = "DOWN"
- Height = 255
- Left = 5640
- TabIndex = 7
- Top = 6240
- Width = 855
- End
- Begin VB.CommandButton Command1
- Caption = "UP"
- Height = 255
- Left = 4560
- TabIndex = 6
- Top = 6240
- Width = 735
- End
- Begin VB.ListBox List3
- Height = 255
- Left = 4560
- TabIndex = 5
- Top = 5880
- Width = 4455
- End
- Begin VB.ListBox List2
- BeginProperty Font
- Name = "Terminal"
- Size = 6
- Charset = 255
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 1860
- Left = 4560
- TabIndex = 4
- Top = 3720
- Width = 4455
- End
- Begin VB.ListBox List1
- Height = 3375
- Left = 4560
- TabIndex = 3
- Top = 120
- Width = 4455
- End
- Begin VB.FileListBox File1
- Height = 4185
- Left = 120
- TabIndex = 2
- Top = 3720
- Width = 4335
- End
- Begin VB.DirListBox Dir1
- Height = 3015
- Left = 120
- TabIndex = 1
- Top = 480
- Width = 4335
- End
- Begin VB.DriveListBox Drive1
- Height = 315
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 4335
- End
- Attribute VB_Name = "Form10"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Dim cellpage As Long
- Dim cellposition As Long
- Dim fileloaded As Integer
- Private Sub Command1_Click()
- Rem move up 1 line
- If fileloaded Then
- If cellposition - 8 - cellpage * 80 > 0 Then
- cellposition = cellposition - 8
- Call DisplayHex
- End If
- MsgBox ("No file loaded.")
- End If
- End Sub
- Private Sub Command10_Click()
- MsgBox ("This public domain program" + Chr$(13) + _
- "written by Erik Jon Oredson" + Chr$(13) + _
- "Email: azathoth@rptanet.org")
- End Sub
- Private Sub Command11_Click()
- Rem search for hex value
- Static a As String * 1
- Static i As String
- Static z As Integer
- Static x As Long
- If fileloaded Then
- i = InputBox("Input hex search value")
- z = Int(Val("&H" + i))
- If z >= 0 And z <= 255 Then
- If cellposition < LOF(1) Then
- For x = cellposition + 1 To LOF(1)
- Get 1, x, a
- If Asc(a) = z Then
- cellposition = x
- cellpage = Int(x / 80)
- Call DisplayHex
- Exit Sub
- End If
- Next
- End If
- MsgBox ("Hex value not found.")
- Else
- MsgBox ("Hex value must be from 00 to FF.")
- End If
- MsgBox ("No file loaded.")
- End If
- End Sub
- Private Sub Command12_Click()
- Rem append to file
- Static a As String * 1
- Static i As String
- Static z As Integer
- If fileloaded Then
- i = InputBox("Input hex value")
- z = Int(Val("&H" + i))
- If z >= 0 And z <= 255 Then
- a = Chr$(z)
- cellposition = LOF(1) + 1
- cellpage = Int(cellposition / 80)
- Put 1, cellposition, a
- Call DisplayHex
- Else
- MsgBox ("Hex value must be from 00 to FF")
- End If
- MsgBox ("No file loaded.")
- End If
- End Sub
- Private Sub Command2_Click()
- Rem move down 1 line
- If fileloaded Then
- If cellposition + 8 - cellpage * 80 <= 80 Then
- If cellposition + 8 <= LOF(1) Then
- cellposition = cellposition + 8
- Call DisplayHex
- End If
- End If
- MsgBox ("No file loaded.")
- End If
- End Sub
- Private Sub Command3_Click()
- Rem move right 1 cell
- If fileloaded Then
- If cellposition + 1 - cellpage * 80 <= 80 Then
- If cellposition + 1 <= LOF(1) Then
- cellposition = cellposition + 1
- Call DisplayHex
- End If
- End If
- MsgBox ("No file loaded.")
- End If
- End Sub
- Private Sub Command4_Click()
- Rem move left 1 cell
- If fileloaded Then
- If cellposition - 1 - cellpage * 80 > 0 Then
- cellposition = cellposition - 1
- Call DisplayHex
- End If
- MsgBox ("No file loaded.")
- End If
- End Sub
- Private Sub Command5_Click()
- Rem page up
- If fileloaded Then
- If cellposition - 80 > 0 Then
- cellposition = cellposition - 80
- cellpage = cellpage - 1
- Else
- cellposition = 1
- cellpage = 0
- End If
- Call DisplayHex
- MsgBox ("No file loaded.")
- End If
- End Sub
- Private Sub Command6_Click()
- Rem page down
- If fileloaded Then
- If cellposition + 80 <= LOF(1) Then
- cellposition = cellposition + 80
- cellpage = cellpage + 1
- Call DisplayHex
- Else
- If (cellpage + 1) * 80 <= LOF(1) Then
- cellposition = (cellpage + 1) * 80 + 1
- cellpage = cellpage + 1
- Call DisplayHex
- Else
- cellposition = LOF(1)
- Call DisplayHex
- End If
- End If
- MsgBox ("No file loaded.")
- End If
- End Sub
- Private Sub Command7_Click()
- Rem input position
- Static i As String
- Static z As Long
- If fileloaded Then
- i = InputBox("Input hex position")
- z = Int(Val(i))
- If z > 0 And z <= LOF(1) Then
- cellposition = z
- cellpage = Int((z - 1) / 80)
- Call DisplayHex
- Else
- MsgBox ("Hex position not within file.")
- End If
- MsgBox ("No file loaded.")
- End If
- End Sub
- Private Sub Command8_Click()
- Rem input value
- Static a As String * 1
- Static i As String
- Static z As Integer
- If fileloaded Then
- i = InputBox("Input hex value")
- z = Int(Val("&H" + i))
- If z >= 0 And z <= 255 Then
- a = Chr$(z)
- Put 1, cellposition, a
- Call DisplayHex
- Else
- MsgBox ("Hex value must be from 00 to FF")
- End If
- MsgBox ("No file loaded.")
- End If
- End Sub
- Private Sub Command9_Click()
- Close
- End Sub
- Private Sub Dir1_Change()
- Form10.File1.Archive = True
- Form10.File1.Hidden = True
- Form10.File1.ReadOnly = True
- Form10.File1.System = True
- Form10.File1.Path = Form10.Dir1.Path
- End Sub
- Private Sub Drive1_Change()
- Form10.Dir1.Path = Form10.Drive1.Drive
- End Sub
- Private Sub File1_Click()
- Static r As Integer
- Static z As Long
- Form10.List1.Clear
- x$ = Form10.Dir1.Path
- If Right$(x$, 1) <> "\" Then
- x$ = x$ + "\"
- End If
- q$ = x$
- Form10.List1.AddItem "Directory:"
- While Len(x$) > 50
- y$ = Left$(x$, 50)
- x$ = Mid$(x$, 51)
- If Len(x$) Then
- y$ = y$ + ".."
- End If
- Form10.List1.AddItem y$
- Wend
- If Len(x$) Then
- Form10.List1.AddItem x$
- End If
- x$ = Form10.File1.filename
- q$ = q$ + x$
- Form10.List1.AddItem "Filename:"
- While Len(x$) > 50
- y$ = Left$(x$, 50)
- x$ = Mid$(x$, 51)
- If Len(x$) Then
- y$ = y$ + ".."
- End If
- Form10.List1.AddItem y$
- Wend
- If Len(x$) Then
- Form10.List1.AddItem x$
- End If
- z = FileLen(q$)
- Form10.List1.AddItem "Filesize: " + Format$(z, "#,##0.0")
- Form10.List1.AddItem "Attributes:"
- r = GetAttr(q$)
- If (r And vbArchive) Then
- Form10.List1.AddItem "Archive"
- End If
- If (r And vbHidden) Then
- Form10.List1.AddItem "Hidden"
- End If
- If (r And vbReadOnly) Then
- Form10.List1.AddItem "Read-only"
- End If
- If (r And vbSystem) Then
- Form10.List1.AddItem "System"
- End If
- Close #1
- Open q$ For Binary As #1
- fileloaded = True
- cellpage = 0
- cellposition = 1
- Call DisplayHex
- End Sub
- Sub DisplayHex()
- Static a As String * 1
- Static n As Long
- Form10.List2.Clear
- n = cellpage * 80
- For l = 1 To 10
- k$ = ""
- For m = 1 To 8
- n = n + 1
- If n > LOF(1) Then
- Exit For
- End If
- Get 1, n, a
- If n = cellposition Then
- k$ = k$ + "[" + Right$("0" + Hex$(Asc(a)), 2) + "] "
- Else
- k$ = k$ + " " + Right$("0" + Hex$(Asc(a)), 2) + " "
- End If
- Next
- Form10.List2.AddItem k$
- If n > LOF(1) Then
- Exit For
- End If
- Form10.List3.Clear
- k$ = "Position:" + Str$(cellposition) + " Cellpage:" + Str$(cellpage)
- Form10.List3.AddItem k$
- End Sub
-